import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class JDBCDemo {
    public static void main(String[] args) {
        String url = "jdbc:mysql://localhost:3306/pet_store?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC";
        String user = "root";        //
        String password = "123456";  //
        try{
            Connection conn= DriverManager.getConnection(url,user,password);
            System.out.println("连接成功！");
            conn.close();
        }catch (SQLException e){
            System.out.println("连接失败"+e.getMessage());
            e.printStackTrace();
        }

    }
}
